import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/Home'
import Login from '@/components/Login'
import Register from '@/components/Register'
import Nbcourse from '@/components/Nbcourse'
import CourseDetail from "../components/CourseDetail"
import Cart from "../components/Cart"
import Jiesuan from "../components/Jiesuan"
import Success from "../components/Success"
import Order from "../components/Order"
import Player from "../components/Playervideo"

Vue.use(Router)

export default new Router({
  mode:'history',
  routes: [
    {
      path: '/',
      component: Home
    },
    {
      path: '/home',
      component: Home
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/register',
      name: 'Register',
      component: Register
    },
    {
      path: '/nbcourses/',
      name: 'Nbcourse',
      component: Nbcourse
    },
    {
      path: '/coursedetail/:id/',   //   /coursedetail/1/     this.$route.params.id
      name: 'coursedetail',
      component: CourseDetail
    },
    {
      path: '/cart/',   //   /coursedetail/1/     this.$route.params.id
      name: 'cart',
      component: Cart,
    },
    {
      path: '/jiesuan/',   //   /coursedetail/1/     this.$route.params.id
      name: 'jiesuan',
      component: Jiesuan,
    },
    {
      path: '/alipay/result/',   //   /coursedetail/1/     this.$route.params.id
      name: 'success',
      component: Success,
    },
    {
      path: '/order/',   //   /coursedetail/1/     this.$route.params.id
      name: 'order',
      component: Order,
    },
    {
      path: '/player/:vid/',   //   /coursedetail/1/     this.$route.params.id
      name: 'player',
      component: Player,
    }
  ]
})
